<template>
  <ed-dialog-button v-bind="$attrs">
    <template v-slot:title>
      {{ title }}
    </template>
    <viewer
      v-bind="dialog"
      v-on="$listeners"
    />
  </ed-dialog-button>
</template>

<script>
import EdDialogButton from './EdDialogButton'
import Viewer from '../views/Viewer'

export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    dialog: {
      type: Object,
      default: () => ({})
    },
    row: {
      type: Object,
      default: () => ({})
    }
  },
  data () {
    return {
      // definition: {}
    }
  },
  // async created () {
  //   // 除非是独立的按钮，循环生成的按钮会造成大量的请求
  //   this.definition = this.dialog.definition ? await fire(this, this.dialog.definition, this.row) : this.dialog
  // },
  components: {
    EdDialogButton,
    Viewer
  }
}
</script>

<style scoped>

</style>
